<html >
<head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="main.css" />
    <script>
  			function init(){
  				tipShow();
  				var urlpath = getUrlParamString("urlpath");
  				var url = urlpath + "/index.html?ver=" + Math.random();
  				window.location.href = url;

  			}
  			function tipShow(){
  			    var initTip = document.getElementById("initTip");
  			    var header = document.getElementById("header");
  				initTip.innerHTML  = "正在初始化，请稍候";
  				header.innerHTML  = "天年宝";
  		 	}
			function getUrlParamString(name) {
				if(!location||!location.href){
					return null;
				}
				// 如果链接没有参数，或者链接中不存在我们要获取的参数，直接返回空
				if (location.href.indexOf("?") == -1 || location.href.indexOf(name + '=') == -1) {
					return null;
				}
				// 获取链接中参数部分
				var queryString = location.href.substring(location.href.indexOf("?") + 1);
				// 分离参数对 ?key=value&key2=value2
				var parameters = queryString.split("&");
				var pos, paraName, paraValue;
				for (var i = 0; i < parameters.length; i++) {
					// 获取等号位置
					pos = parameters[i].indexOf('=');
					if (pos == -1) {
						continue;
					}
					// 获取name 和 value
					paraName = parameters[i].substring(0, pos);
					paraValue = parameters[i].substring(pos + 1);

					// 如果查询的name等于当前name，就返回当前值，同时，将链接中的+号还原成空格
					if (paraName == name) {
						return unescape(paraValue.replace(/\+/g, " "));
					}
				}
				return '';
			};
  		</script>
</head>
<body onload="init();">
<div id="header" class="header"></div>
<div class="loadArea">
    <div class="imgLogo"><img src="logo.png" alt=""></div>
    <div class="imageArea"><img src="loading.gif"/></div>
    <div class="loadTip" id="initTip"></div>
</div>
</body>
</html>
